//
//  DbManagers.h
//  Flight
//
//  Created by haiming on 13-8-7.
//  Copyright (c) 2013年 haiming. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"

typedef enum{
    ShopLikeType,
    CouponLikeType,
    GourmetLikeType,
    ActivityLikeType,
    DeliveryLikeType,
    PhotoLikeType
}LikeType;

@interface DbManager : NSObject
{
    FMDatabase* dataBase;
}

@property (strong, nonatomic) FMDatabase* dataBase;

+ (id)sharedManager;

- (BOOL)hasList;

-(void)createTables;
- (void)clearMenuList;
-(void)insertCuisines:(NSArray*)array;
-(void)insertAreas:(NSArray*)array;
-(void)insertCircles:(NSArray*)array withAreaId:(NSString *)areaId;
-(void)insertOrders:(NSArray*)array;
-(void)insertDistances:(NSArray *)array;

-(NSMutableArray*)fetchCuisines;
-(NSMutableArray*)fetchAreas;
-(NSMutableArray*)fetchCirclesWithAreaId:(NSString *)areaId;
-(NSMutableArray*)fetchOrders;
-(NSMutableArray*)fetchDistances;

- (void)clearLikes;
- (void)insertLike:(NSString *)sid type:(LikeType)type;
- (BOOL)isLike:(NSString *)sid type:(LikeType)type;

@end
